package com.redis.cluster;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootApplication
public class RedisClusterApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(RedisClusterApplication.class, args);
        RedisTemplate<String, String> redisTemplate = context.getBean("myTemplate", RedisTemplate.class);
        for (int i = 0; i < 100; i++) {
            redisTemplate.opsForValue().set("H_" + i, "Hello lilei" + i);
        }
    }

}
